final static String OpenBuffersLabel = jEdit.getProperty("macro.rs.BufferSwitcher.OpenBuffers.label", "open Buffers");
final static String QuickHelpLabel = jEdit.getProperty("macro.rs.BufferSwitcher.QuickHelp.label", "[ENTER] Switch to; [SPACE] Switch to, keep dialog; [DEL] Close Buffer");
final static String Help1Label = jEdit.getProperty("macro.rs.BufferSwitcher.Help1.label", "Help for Buffer Switcher macro:");
final static String Help2Label = jEdit.getProperty("macro.rs.BufferSwitcher.Help2.label", "DELETE closes selected buffer.");
final static String Help3Label = jEdit.getProperty("macro.rs.BufferSwitcher.Help3.label", "ENTER switches to selected buffer, closes dialog.");
final static String Help4Label = jEdit.getProperty("macro.rs.BufferSwitcher.Help4.label", "ESCAPE closes dialog.");
final static String Help5Label = jEdit.getProperty("macro.rs.BufferSwitcher.Help5.label", "SPACE switches to selected buffer, does not close dialog.");
final static String Help6Label = jEdit.getProperty("macro.rs.BufferSwitcher.Help6.label", "NOTE: This dialog will only be displayed once");
/*
* Custom Cell Renderer which displays the buffer icons in the JList.
* As it runs a little slowly on my machine, it is not used by default.
*
* set useCustomCellRenderer to true at the bottom of this macro to use this.
*/
// {{{ BufferCellRenderer
BufferCellRenderer()
{
l = new JLabel();
l.setOpaque(true);
Component getListCellRendererComponent(
JList list,
Object value,
int index,
boolean isSelected,
boolean cellHasFocus)
{
l.setText(value.toString());
l.setIcon(value.getIcon());
if (isSelected)
{
l.setBackground(list.getSelectionBackground());
l.setForeground(list.getSelectionForeground());
}
else
{
l.setBackground(list.getBackground());
l.setForeground(list.getForeground());
}
return l;
}
return this;
} // }}}
/*
* BufferSwitcherDialog - Dialog allows one to switch between